  <script type="text/javascript">
    function trim(s)
	{
  		return s.replace(/^\s+|\s+$/, '');
	}
	
    function validaEmail(fld, error_field) 
	{
		fld = document.getElementById(fld);
    	var my_field=document.getElementById(error_field);
    	var tfld = trim(fld.value);
    	var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    	var illegalChars= /[\#\$\'\(\)\<\>\,\;\:\\\"\[\]]/ ;
    	erro = "";
   		
    	if (fld.value == "") {
        	fld.style.background = '#FF9393';
        	my_field.style.background = '#FFFFAE';
    		my_field.style.display = '';
    		my_field.innerHTML = "<?=REGISTO_STEP1_ERRO_EMAIL_VAZIO ?>";
    		erro = "<?=REGISTO_STEP1_ERRO_PASS_NUM ?>";
    	} else if (!emailFilter.test(tfld)) {              //test email for illegal characters
        	fld.style.background = '#FF9393';
        	my_field.style.background = '#FFFFAE';
    		my_field.style.display = '';
    		my_field.innerHTML = "<?=REGISTO_STEP1_ERRO_EMAIL_INC ?>";
    		erro = "<?=REGISTO_STEP1_ERRO_PASS_NUM ?>";
    	} else if (fld.value.match(illegalChars)) {
        	fld.style.background = '#FF9393';
        	my_field.style.background = '#FFFFAE';
    		my_field.style.display = '';
    		my_field.innerHTML = "<?=REGISTO_STEP1_ERRO_EMAIL_ILE ?>";
    		erro = "<?=REGISTO_STEP1_ERRO_PASS_NUM ?>";
    	} else {
        	fld.style.background = 'White';
    	}
    	return erro;
	}
	
	function validaTodos() 
	{
		reason = validaEmail('utilizador', 'form_erro');
  		
  		if (reason != "") {
    		return false;
  		}
  		return true;
  	}
  </script>  
  <div id="page_content">
   <div id="registo_area">
    <p></p>
    <p><font style="text-align: center;"><h3><?=IDIOMA_RECUPERAR_STEP1_INFO ?></h3></font></p>
    <div style="display: none; text-align: center; width: 50%; min-height: 20px; margin: auto;" id="form_erro">
	</DIV>
	<p></p>
	<form method="post" onsubmit="return validaTodos()">
	 <LABEL for="email"><?=IDIOMA_RECUPERAR_STEP1_EMAIL?>: </LABEL>
	  <INPUT type="text" id="email" name="email" onblur="validaEmail('email', 'form_erro')">
	  <span class="form_obrigatorio">*</span>
	  <BR />
	 <div class="btns" style="text-align: center">
	  <INPUT type="submit" value="<?=IDIOMA_RECUPERAR_STEP1_CONTINUAR?>"> 
	 </div>
	 <INPUT type="hidden" value="2" name="step" id="step">
	</form>
	<?
	   echo REGISTO_CAMPOS_OBRIG . "<br />";
	?>
	<?
	if($_POST)
	{
		if(isset($mensagem))
		{
			echo $mensagem;
		}
	}	
	?>
   </div>
   <A HREF="/utilizadores">Voltar</A><br />
  </div>